package com.od.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.od.entity.Province;
import com.od.service.ProvinceService;

@Controller
@RequestMapping("province")
@CrossOrigin
public class ProvinceController {
    @Autowired
    private ProvinceService provinceService;
    
    @RequestMapping("allProvinces")
    @ResponseBody
    public List<Province> allProvinces() {
        return provinceService.getAllProvinces();
    }
}
